package com.designpatterns.creational.singleton;

/**
 * 静态内部类单例模式
 */
public class HolderSingleton {
    private HolderSingleton() {
    }

    //静态内部类
    private static class HolderClass {
        private final static HolderSingleton instance = new HolderSingleton();
    }

    public static HolderSingleton getInstance() {
        return HolderClass.instance;
    }
}
